import { Suspense, lazy } from 'react'
import {Routes,Route,Navigate} from 'react-router-dom'  
const Index = lazy(()=>import('./pages/index.jsx')) 
const List = lazy(()=>import('./pages/List.jsx')) 
const Login = lazy(()=>import('./pages/Login.jsx')) 
const Reigster = lazy(()=>import('./pages/register.jsx')) 
const Oreder = lazy(()=>import('./pages/Oreder.jsx')) 
const Detail = lazy(()=>import('./pages/detail.jsx')) 
const Discount = lazy(()=>import('./pages/Discount.jsx')) 
function App(){
    return(
        <div>
            <Suspense>
                <Routes>
                    <Route path='/index/*' element={<Index/>}></Route>
                    <Route path='/list' element={<List/>}></Route>
                    <Route path='/login' element={<Login/>}></Route>
                    <Route path='/register' element={<Reigster/>}></Route>
                    <Route path='/oreder' element={<Oreder/>}></Route>
                    <Route path='/detail' element={<Detail/>}></Route>
                    <Route path='/coupon' element={<Discount/>}></Route>
                    <Route path='*' element={<Navigate to='/index'></Navigate>}></Route>
                </Routes>
            </Suspense>
            
        </div>
    )
}
export default App